<template>
	<div id="app">
		<!-- 添加路由视图来挂载所有路由组件 -->
		<router-view v-if="isRouterAlive" />
	</div>
</template>

<script>
	export default {
		name: 'App',
		//实现局部刷新数据
		provide() {
			return {
				reload: this.reload
			}
		},
		data() {
			return {
				isRouterAlive: true
			};
		},
		methods: {
			reload() {
				this.isRouterAlive = false;
				this.$nextTick(() => {
					this.isRouterAlive = true;
				})
			}
		}
	}
</script>

<style>
	#app {
		font-family: Avenir, Helvetica, Arial, sans-serif;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}

	body {
		margin: 0;
		padding: 0;
	}
</style>
